<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@include file="/init.jsp"%>
<jsp:useBean id="DataManager" class="dto.DataManager" scope="application"></jsp:useBean>
<jsp:useBean id="DtoCard" class="dto.DtoCard" scope="application"></jsp:useBean>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/scrip.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>View Card Admin</title>
</head>
<body>
	<div class="master-wrapper-content">
	<jsp:include page="heading.jsp"></jsp:include>
	<%
		System.out.println(session.getAttribute("roleId"));
		if(session.getAttribute("roleId") == null || String.valueOf(session.getAttribute("roleId")).equalsIgnoreCase("2")) {
			%>
				<h3 style="color: red">Không đủ quyền để truy cập</h3>
			<%
		}
		else {
	%>
			<jsp:include page="CategoryAdmin.jsp"></jsp:include>
			<div class="container-right">
				<div class="ml-banner">
					<div class="ml-title">Thống kê tình trạng kho card</div>
				</div>
				<table class="table-view">
									<tr class="title">
										<th>Mệnh giá</th>
										<th>Số lượng đã nạp</th>
										<th>Tổng tiền đã nạp</th>
										<th>Số lượng còn</th>
										<th>Tổng tiền còn</th>
									</tr>
									<tr class="even">
										<td>50000 VNĐ</td>
										<td><%=DataManager.countCardByMoneyAndStatus(50000, 0) %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(50000, 0)*50000 %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(50000, 1)%></td>
										<td><%=DataManager.countCardByMoneyAndStatus(50000, 1)*50000 %></td>
									</tr>
									<tr class="even">
										<td>100000 VNĐ</td>
										<td><%=DataManager.countCardByMoneyAndStatus(100000, 0) %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(100000, 0)*100000 %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(100000, 1)%></td>
										<td><%=DataManager.countCardByMoneyAndStatus(100000, 1)*100000 %></td>
									</tr>
									<tr class="even">
										<td>200000 VNĐ</td>
										<td><%=DataManager.countCardByMoneyAndStatus(200000, 0) %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(200000, 0)*200000 %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(200000, 1)%></td>
										<td><%=DataManager.countCardByMoneyAndStatus(200000, 1)*200000 %></td>
									</tr>
									<tr class="even">
										<td>500000 VNĐ</td>
										<td><%=DataManager.countCardByMoneyAndStatus(500000, 0) %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(500000, 0)*500000 %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(500000, 1)%></td>
										<td><%=DataManager.countCardByMoneyAndStatus(500000, 1)*500000 %></td>
									</tr>
									<tr class="even">
										<td>1000000 VNĐ</td>
										<td><%=DataManager.countCardByMoneyAndStatus(1000000, 0) %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(1000000, 0)*1000000 %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(1000000, 1)%></td>
										<td><%=DataManager.countCardByMoneyAndStatus(1000000, 1)*1000000 %></td>
									</tr>
									<tr class="even">
										<td>5000000 VNĐ</td>
										<td><%=DataManager.countCardByMoneyAndStatus(5000000, 0) %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(5000000, 0)*5000000 %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(5000000, 1)%></td>
										<td><%=DataManager.countCardByMoneyAndStatus(5000000, 1)*5000000 %></td>
									</tr>
									<tr class="even">
										<td>10000000 VNĐ</td>
										<td><%=DataManager.countCardByMoneyAndStatus(10000000, 0) %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(10000000, 0)*10000000 %></td>
										<td><%=DataManager.countCardByMoneyAndStatus(10000000, 1)%></td>
										<td><%=DataManager.countCardByMoneyAndStatus(10000000, 1)*10000000 %></td>
									</tr>
				</table>
				<p align="center" ><a class="linklon" href="addCardAdminForm.jsp">Thêm Card</a></p>
				</div>
				<div class="clear"> </div>
			<%
				} 
			%>
	<jsp:include page="footer.jsp"></jsp:include>
	</div>
</body>
</html>